<div class="main-header">
    <div class="btn-list">
        <a ng-if="roleid!=6" href="javascript:void(0)" id="newItem" ng-click="edit()">
            <span class="glyphicon glyphicon-plus"></span>新增隐患
        </a>
    </div>
</div>
<div class="main-con">
    <div class="row">
        <!--list -->
        <div class="col-xs-4">
            <search-box search-data="searchData" search-submit="getDangerList(true)"></search-box>
            <div class="result-bar">
                共<span class="mColor" ng-bind="count"></span>条记录
            </div>
            <div class="lft-wrap box-shadow" when-scrolled="getDangerList()">
                <ul class="data-list" repeat-list="getRgtModel()" active-id="{{activeId}}">
                    <li ng-repeat="item in dangerList track by $index" relativeId="{{item.Id}}" ng-class="{active:$index==0}">
                        <div class="media-left">
                            <div class="icon-box" ng-class="{gray:!item.Icon}">
                                <img ng-if="item.Icon" class="media-object img-circle" alt="" width="60" height="60" ng-src="{{item.Icon}}">
                                <i ng-if="!item.Icon" class="fa fa-warning"></i>
                            </div>
                        </div>
                        <div class="media-body">
                            <div class="panel-info">
                                <dl>
                                    <dt>隐患编码:</dt>
                                    <dd>
                                        <a class="title link-txt" href="javascript:void(0)" ng-bind="item.Code"></a>
                                    </dd>
                                </dl>
                                <dl>
                                    <dt>状态:</dt>
                                    <dd>
                                        <span class="statu-txt" ng-bind="DangerStatus|getEmunName:item.DangerStatus"></span>
                                    </dd>
                                </dl>
                                <dl>
                                    <dt>紧急程度:</dt>
                                    <dd>
                                        <span ng-class="{true: 'danger-txt', false: 'default-txt'}[item.MissionLevel=='2']" ng-bind="MissionLevel|getEmunName:item.MissionLevel"></span>
                                    </dd>
                                </dl>
                                <dl>
                                    <dt>上报时间:</dt>

                                    <dd ng-bind="item.CreateTime | date :'yyyy-MM-dd HH:mm:ss'"></dd>
                                    <!--<dd ng-bind="item.CreateTime | date : 'yyyy-MM-dd HH:mm:ss'"></dd>-->
                                </dl>
                                <dl>
                                    <dt>上报人:</dt>
                                    <dd ng-bind="item.HandlerName"></dd>
                                </dl>
                            </div>
                        </div>
                        <div class="media-right">
                            <div ng-if="roleid!=6" class="btn-wrap">
                                <a ng-class="{disabled:item.DangerStatus!=0}" href="javascript:void(0)" title="编辑" ng-click="edit(item,$index);$event.stopPropagation();">
                                    <span class="glyphicon glyphicon-edit"></span></a>
                                <!--<a href="javascript:void(0)" title="删除" ng-click="del(item,$index);$event.stopPropagation();">
                                    <span class="glyphicon glyphicon-trash"></span></a>-->
                                <a href="javascript:void(0)" ng-class="{disabled:item.DangerStatus==2}" class="destroy" ng-click="cancelDanger(item);$event.stopPropagation();">
                                    <span class="glyphicon glyphicon-pencil" title="消除隐患"></span></a>
                                <a href="javascript:void(0)" ng-class="{disabled:item.DangerStatus!=0}" ng-click="mission(item);$event.stopPropagation();">
                                    <span class="glyphicon glyphicon-share-alt" title="派发任务"></span></a>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        <!--内容块-->
        <div class="col-xs-8">
            <div class="rgt-wrap box-shadow">
                <div class="widget flat radius-bordered">
                    <tabset flat="true">
                        <tab heading="位置信息">
                            <div ng-show="activeId">


                            </div>

                            <wt-map mapid="map2" height="800" showgdmap="false" map-intialed="mapcadIntialed(this)"></wt-map>
                        </tab>
                        <tab heading="详细信息">
                            <div ng-show="activeId">
                                <div class="row">
                                    <div class="panel-info report">
                                        <dl>
                                            <dt>隐患编号:</dt>
                                            <dd ng-bind="dangerDetailModel.Code"></dd>
                                        </dl>
                                        <dl>
                                            <dt>状态:</dt>
                                            <dd ng-bind="DangerStatus|getEmunName:dangerDetailModel.DangerStatus"></dd>
                                        </dl>
                                        <!-- <dl>
                                            <dt>隐患位置:</dt>
                                            <dd>
                                                <a class="title link-txt" href="javascript:void(0)" ng-bind="dangerDetailModel.Addr"></a>
                                            </dd>
                                        </dl> -->
                                        <dl>
                                            <dt>上报时间:</dt>
                                            <dd ng-bind="dangerDetailModel.CreateTime | date : 'yyyy-MM-dd HH:mm:ss'"></dd>
                                        </dl>
                                        <dl>
                                            <dt>上报人员:</dt>
                                            <dd ng-bind="dangerDetailModel.HandlerName"></dd>
                                        </dl>
                                        <dl>
                                            <dt>紧急程度:</dt>
                                            <dd ng-bind="MissionLevel|getEmunName:dangerDetailModel.MissionLevel"></dd>
                                        </dl>
                                        <dl>
                                            <dt>类型:</dt>
                                            <dd ng-bind="dangerDetailModel.DangerType"></dd>
                                        </dl>
                                        <dl>
                                            <dt>隐患主题:</dt>
                                            <dd ng-bind="dangerDetailModel.Name"></dd>
                                        </dl>
                                        <!--<dl>
                                            <dt>维修任务编号:</dt>
                                            <dd>
                                                <a href="javascript:void(0)" ng-click="detail(dangerDetailModel.ServicingCode)" ng-bind="dangerDetailModel.ServicingCode"></a>
                                            </dd>
                                        </dl>-->
                                        <dl>
                                            <dt>隐患描述:</dt>
                                            <dd ng-bind="dangerDetailModel.Note"></dd>
                                        </dl>
                                    </div>
                                    <div class="thumbs" id="dangerThumbs">
                                        <a target-href="{{item.Url}}" style="background-image:url({{item.Url}})" thumbs-list="dangerThumbs" ng-repeat="item in dangerDetailModel.Imgs track by $index"></a>
                                    </div>
                                </div>
                                <div class="row" ng-if="dangerDetailModel.ServicingCode">
                                    <div class="panel-info report">
                                        <dl>
                                            <dt>维修任务编号:</dt>
                                            <dd ng-bind="servicingDetailModel.Id"></dd>
                                        </dl>
                                        <dl>
                                            <dt>状态:</dt>
                                            <dd ng-bind="MissionStatus|getEmunName:servicingDetailModel.MissionStatus"></dd>
                                        </dl>
                                        <dl>
                                            <dt>紧急程度:</dt>
                                            <dd ng-bind="MissionLevel|getEmunName:servicingDetailModel.MissionLevel"></dd>
                                        </dl>
                                        <dl>
                                            <dt>处理人:</dt>
                                            <dd ng-bind="servicingDetailModel.HandlerName"></dd>
                                        </dl>
                                        <dl>
                                            <dt>创建时间:</dt>
                                            <dd ng-bind="servicingDetailModel.CreateTime | date : 'yyyy-MM-dd HH:mm:ss'"></dd>
                                        </dl>
                                        <dl>
                                            <dt>创建人:</dt>
                                            <dd ng-bind="servicingDetailModel.User"></dd>
                                        </dl>
                                        <dl>
                                            <dt>维修要点:</dt>
                                            <dd ng-bind="servicingDetailModel.Note"></dd>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                        </tab>
                    </tabset>
                </div>
            </div>
        </div>
    </div>
</div><!-- 编辑隐患信息 -->
<div class="modal" id="editModal">
    <div class="modal-dialog">
        <form name="dangerForm" ng-submit="dangerFormSubmit()" novalidate>
            <div class="modal-content" ng-show="!isShowGetPosition">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span> <span class="sr-only">Close</span>
                    </button>
                    <h4 class="modal-title" ng-bind="editModalTitle"></h4>
                </div>
                <div class="modal-body">
                    <!--<div class="form-group" class="form-group" ng-class="{'has-error' : dangerForm.Code.$dirty&&dangerForm.Code.$invalid}">
                        <div class="input-icon icon-right">
                            <input type="text" name="Code" class="form-control" ng-model="dangerModel.Code" placeholder="隐患编号" required>
                            <p ng-show="dangerForm.Code.$dirty && dangerForm.Code.$error.required" class="help-block">隐患编号是必需的，并且不能是空的</p>
                        </div>
                    </div>-->
                    <div class="form-group" ng-class="{ 'has-error' : dangerForm.HandlerId.$dirty&&dangerForm.HandlerId.$invalid}">
                        <div class="input-icon icon-right">
                            <select name="HandlerId" class="form-control" ng-model="dangerModel.HandlerId" ng-options="item.Id as item.Name for item in userList" required>
                                <option value="" disabled selected>请选择(上报人员)</option>
                            </select>
                            <p ng-show="dangerForm.HandlerId.$dirty && dangerForm.HandlerId.$error.required" class="help-block">处理人员的，并且不能是空的</p>
                        </div>
                    </div>
                    <div class="form-group" ng-class="{ 'has-error' : dangerForm.MissionLevel.$dirty&&dangerForm.MissionLevel.$invalid}">
                        <div class="input-icon icon-right">
                            <select name="MissionLevel" class="form-control" ng-model="dangerModel.MissionLevel" ng-options="value as key for (key ,value) in MissionLevel" required>
                                <option value="" disabled selected>请选择(紧急程度)</option>
                            </select>
                            <p ng-show="dangerForm.MissionLevel.$dirty && dangerForm.MissionLevel.$error.required" class="help-block">紧急程度是必需的，并且不能是空的</p>
                        </div>
                    </div>
                    <div class="form-group" ng-class="{ 'has-error' : dangerForm.DangerType.$dirty&&dangerForm.DangerType.$invalid}">
                        <div class="input-icon icon-right">
                            <select name="DangerType" class="form-control" ng-model="dangerModel.DangerType" ng-options="dangerType.Id as dangerType.Name for dangerType in dangerTypeList" required>
                                <option value="" disabled selected>请选择(隐患类型)</option>
                            </select>
                            <p ng-show="dangerForm.DangerType.$dirty && dangerForm.DangerType.$error.required" class="help-block">隐患类型是必需的，并且不能是空的</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-icon icon-right" ng-click="openSetPositionPanel()">
                            <input type="text" value="坐标为：X: {{ dangerModel.Lng }} Y: {{dangerModel.Lat}} " readonly="readonly" class="form-control map-input" placeholder="隐患位置">
                            <i class="fa fa-map-marker circular"></i>
                        </div>
                        <div class="hidden">
                            <inpu type="text" name="Lng" ng-model="dangerModel.Lng"></inpu>
                            <inpu type="text" name="Lat" ng-model="dangerModel.Lat"></inpu>
                        </div>
                    </div>
                    <div class="form-group" ng-class="{ 'has-error' : dangerForm.Name.$dirty&&dangerForm.Name.$invalid}">
                        <div class="input-icon icon-right">
                            <input name="Name" type="text" class="form-control" ng-model="dangerModel.Name" placeholder="隐患主题" ng-minlength="2" ng-maxlength="30" required>
                            <p ng-show="dangerForm.Name.$dirty && dangerForm.Name.$error.required" class="help-block">隐患主题是必需的，并且不能是空的</p>
                            <p ng-show="dangerForm.Name.$error.minlength||dangerForm.Name.$error.maxlength" class="help-block">隐患主题为2到30个字符</p>
                        </div>
                    </div>
                    <div class="form-group" class="form-group" ng-class="{'has-error' : dangerForm.Note.$dirty&&dangerForm.Note.$invalid}">
                        <div class="textarea-box">
                            <textarea name="Note" placeholder="隐患描述" ng-model="dangerModel.Note" required></textarea>
                            <p ng-show="dangerForm.Note.$dirty && dangerForm.Note.$error.required" class="help-block">隐患描述是必需的，并且不能是空的</p>
                        </div>
                    </div>
                    <div class="form-title">选填</div>
                    <div class="form-group">
                        <uploader-file ng-model="dangerModel.Imgs" type="img"></uploader-file>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary" ng-disabled="dangerForm.$invalid">确定</button>
                    <button type="button" class="btn btn-warning" data-dismiss="modal">取消</button>
                </div>
            </div>
            <div class="modal-content" ng-show="isShowGetPosition">
                <div class="modal-header">
                    <h4 class="modal-title">请选择位置</h4>
                </div>
                <div class="modal-body">
                    <!--引入设置中心点指令-->
                    <wtmap-get-position option="getPositionOption" position="selectedPosition">

                    </wtmap-get-position>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" ng-click="closeGetPositionPanel()">确定</button>
                </div>

            </div>
        </form>
    </div>
</div><!-- 删除隐患 -->
<div class="modal fade" id="delModal">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">&times;</span> <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">确定删除吗?</h4>
            </div>
            <div class="modal-body">
                <div class="panel-info">
                    <dl>
                        <dt>隐患编码:</dt>
                        <dd ng-bind="delModel.Code"></dd>
                    </dl>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-warning" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" ng-click="delConfirm()">确定</button>
            </div>
        </div>
    </div>
</div><!-- 派发 -->
<div class="modal fade" id="missionModal">
    <div class="modal-dialog">
        <form name="missionForm" ng-submit="missionFormSubmit()" novalidate>
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span> <span class="sr-only">Close</span>
                    </button>
                    <h4 class="modal-title">派发维修任务</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group" ng-class="{ 'has-error' : missionForm.MissionLevel.$dirty&&missionModal.MissionLevel.$invalid}">
                        <div class="input-icon icon-right">
                            <select name="MissionLevel" class="form-control" ng-model="missionModel.MissionLevel" ng-options="value as key for (key ,value) in MissionLevel" required>
                                <option value="" disabled selected>请选择(紧急程度)</option>
                            </select>
                            <p ng-show="missionModal.MissionLevel.$dirty && missionModal.MissionLevel.$error.required" class="help-block">紧急程度是必需的，并且不能是空的</p>
                        </div>
                    </div>
                    <div class="form-group" ng-class="{ 'has-error' : missionForm.HandlerId.$dirty&&missionForm.HandlerId.$invalid}">
                        <div class="input-icon icon-right">
                            <select name="HandlerId" class="form-control" ng-model="missionModel.HandlerId" ng-options="item.Id as item.Name for item in userList" required>
                                <option value="" disabled selected>请选择(处理人)</option>
                            </select>
                            <p ng-show="missionForm.HandlerId.$dirty && missionForm.HandlerId.$error.required" class="help-block">处理人是必须的，并且不能是空的</p>
                        </div>
                    </div>
                    <div class="form-group" ng-class="{'has-error' : dangerForm.Note.$dirty&&dangerForm.Note.$invalid}">
                        <div class="textarea-box">
                            <textarea name="Note" placeholder="维修要点" ng-model="missionModel.Note" required></textarea>
                            <p ng-show="dangerForm.Note.$dirty && dangerForm.Note.$error.required" class="help-block">维修要点是必需的，并且不能是空的</p>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary" ng-disabled="missionForm.$invalid">确定</button>
                    <button type="button" class="btn btn-warning" data-dismiss="modal">取消</button>
                </div>
            </div>
        </form>
    </div>
</div><!-- 维修编号 -->
<div class="modal fade" id="detailModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">&times;</span> <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">维修任务概况</h4>
            </div>
            <div class="modal-body">
                <div class="panel-info report">
                    <dl>
                        <dt>维修任务编号:</dt>
                        <dd ng-bind="servicingDetailModel.Id"></dd>
                    </dl>
                    <dl>
                        <dt>状态:</dt>
                        <dd ng-bind="MissionStatus|getEmunName:servicingDetailModel.MissionStatus"></dd>
                    </dl>
                    <dl>
                        <dt>紧急程度:</dt>
                        <dd ng-bind="MissionLevel|getEmunName:servicingDetailModel.MissionLevel"></dd>
                    </dl>
                    <dl>
                        <dt>处理人:</dt>
                        <dd ng-bind="servicingDetailModel.HandlerName"></dd>
                    </dl>
                    <dl>
                        <dt>创建时间:</dt>
                        <dd ng-bind="servicingDetailModel.CreateTime | date : 'yyyy-MM-dd HH:mm:ss'"></dd>
                    </dl>
                    <dl>
                        <dt>创建人:</dt>
                        <dd ng-bind="servicingDetailModel.User"></dd>
                    </dl>
                    <dl>
                        <dt>维修要点:</dt>
                        <dd ng-bind="servicingDetailModel.Note"></dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>
</div>


